@extends('layouts.app')

@section('title', '登录')

@section('content')
<div class="bg-wrapper">
	<header class="top-header header-there">
		<div class="container">
			<nav class="navbar navbar-default">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
						<span class="sr-only">切换导航</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="#">
						<img src="{{ asset('statics/images/icon_logo_homepage.png') }}" alt="logo">
					</a>
				</div>
				<div class="collapse navbar-collapse" id="navbar-collapse">
					@include('layouts.nav')
				</div>
			</nav>
		</div>
	</header>
	<div class="loginBg"></div>
	<div class="wrapper-box">
		<div class="container">
			<div class="login-tab">
				<div class="row">
					<div class="col-md-7">
						<div class="wrapper-box-left">
							<div class="tc-summary">
								<div class="tc-introduce">
									<h2>海燕社官网</h2>
									<i class="tc-introduce-line"></i>
									<p>本站提供广东海燕电子音像出版社/广东语言音像电子出版社的产品信息和相关服务。</p>
									<img src="{{ asset('statics/images/accounts.png') }}" alt="星星亮app" />
									<img src="{{ asset('statics/images/icon_letong_wxqr.jpg') }}" style="height: 103px;" alt="乐童" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-5">
						<div class="wrapper-box-right">
							<div class="wrapper-box-container">
								<div class="login-header clearfix">
									<ul>
										<li class="f_left on"><a href="#">账户登录</a></li>
										<li class="f-right"><a href="{{ route('register') }}" target="_self">新用户注册</a></li>
									</ul>
								</div>
								<form class="form-horizontal" method="POST" action="{{ route('login') }}">
									{{ csrf_field() }}
									<div class="form-group">
										<label for="inputAcount" class="col-sm-3 control-label">账户：</label>
										<div class="col-sm-9">
											<input type="text" name="name" class="form-control" value="{{ old('name') }}" id="name" placeholder="请输入账户或手机号码">
										</div>
									</div>
									<div class="form-group">
										<label for="inputPassword" class="col-sm-3 control-label">密码：</label>
										<div class="col-sm-9">
											<input type="password" name="password" class="form-control" id="inputPassword" placeholder="请输入密码">
										</div>
									</div>
									@if ($errors->has('name'))
										<span class="help-block" style="color: red">
                                            <strong>{{ $errors->first('name') }}</strong>
                                        </span>
									@endif
									<div class="form-group">
										<div class="col-sm-12">
											<div class="checkbox">
												<label>
													<input type="checkbox" name="remember" id="check" {{ old('remember') ? 'checked' : '' }}>下次自动登录
												</label>
											</div>
										</div>
									</div>
									<div class="form-group">
										<div class="col-sm-12">
											<button type="submit" class="btn btn-lg btn-block" id="btn">账户登录</button>
										</div>
									</div>
									<div class="form-group">
										<div class="col-sm-12">
											<a href="{{ route('getVerifyMobile') }}" class="find-pwd">忘记密码</a>
										</div>
									</div>
								</form>
								{{--<div class="other-login">--}}
									{{--<p>其他方式</p>--}}
									{{--<div class="OAuth">--}}
										{{--<a href="#" target="_self"><i class="icon-wechat"></i></a>--}}
										{{--<a href="#" target="_self"><i class="icon-qq"></i></a>--}}
										{{--<a href="#" target="_self"><i class="icon-weibo"></i></a>--}}
									{{--</div>--}}
								{{--</div>--}}
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="footer-box">
		<div class="footer">
			<p class="copyright"><a href="http://www.miitbeian.gov.cn/" target="_blank">粤ICP备18042315号-1</a>&nbsp;&nbsp;网络文化经营许可证：粤网文【2016】1229-257&nbsp;&nbsp;增值电信业务经营许可证：粤B2-20140070&nbsp;&nbsp;网络出版服务许可证：（总）网出证（粤）字第039号</p>
			<p>Copyright &copy; 2018 www.gdhys.com 版权所有</p>
		</div>
	</div>
</div>
@stop

@section('script')
	<script src="{{ asset('statics/js/jplaceholder.js') }}" ></script>
	<script>
        //---------------------登录注册页屏幕小于970时响应式--------------------//
        function adjust(){
            var w=$(window).width();
            if(w<=970){
                $(".bg-wrapper").css("height","auto");
                $(".wrapper-box .col-md-5").css("margin-top","30px");
                $(".login-tab").css({"position":"static","margin-top":"80px"})
            }else{
                $(".wrapper-box .col-md-5").css("margin-top","0");
            }
        }
        adjust();
        $(window).resize(function(){
            adjust();
        })

        //---------------------记住用户名和密码--------------------//
        var user = document.getElementById('inputAcount');
        var password = document.getElementById('inputPassword');
        var check = document.getElementById('check');
        var btn = document.getElementById('btn');
        var loUser = localStorage.getItem('user');
        var loPass = localStorage.getItem('pass');
        user.value= loUser;
        password.value = loPass;
        // 判断本地存储值不为空的时候将勾选的checked设置为空
        if(loUser!==''&&loPass!==''){
            check.setAttribute('checked','');
        }
        btn.onclick=function(){
            if(check.checked){
                localStorage.setItem('user',user.value);
                localStorage.setItem('pass',password.value);
            }else{
                localStorage.setItem("user","");
                localStorage.setItem("pass","");
            }
        }
	</script>
@stop
